﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.NetworkInformation;
using System.Net;

namespace Spinnerets.Network.Instrumentation
{
    public class DeviceFoundArgs : EventArgs
    {
        /// <summary>
        /// Gets or sets the ping reply.
        /// </summary>
        /// <value>The reply.</value>
        public PingReply Reply { get; set; }
        /// <summary>
        /// Gets or sets the host entry.
        /// </summary>
        /// <value>The host entry.</value>
        public IPHostEntry HostEntry { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="DeviceFoundArgs"/> class.
        /// </summary>
        /// <param name="pingReply">The ping reply.</param>
        public DeviceFoundArgs(PingReply pingReply)
        {
            Reply = pingReply;
            HostEntry = Dns.GetHostEntry(pingReply.Address);
        }
    }
}
